rest api validation in nodejs